#!/usr/bin python3
# -*- coding: utf-8 -*-
"""  用户注册controller   """
from flask import jsonify, request, make_response
from flask import Blueprint

from gtm_server.services.user import register_user

user_bp = Blueprint("user", __name__, url_prefix="/user")


@user_bp.route("/register", methods=["POST"])
def api_register_user():
    request_data = request.json

    print(request_data)
    result = register_user(user_data=request_data)
    print(result)
    response = make_response(jsonify(result))

    return response


@user_bp.route("/register", methods=["POST"])
def api_all_user_query():
    # TODO:获取所有的用户列表
    # request_data = request.json
    #
    # print(request_data)
    # result = register_user(user_data=request_data)
    # print(result)
    response = make_response(jsonify())

    return response


@user_bp.route("/register", methods=["POST"])
def api_a_user_query():
    # TODO:获取指定用户信息 （根据账户查询）
    # request_data = request.json
    #
    # print(request_data)
    # result = register_user(user_data=request_data)
    # print(result)
    response = make_response(jsonify())

    return response